<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	    		xmlns:ui="http://java.sun.com/jsf/facelets"
	  			xmlns:h="http://java.sun.com/jsf/html"
	  			xmlns:f="http://java.sun.com/jsf/core"
	  			xmlns:sf="http://www.springframework.org/tags/faces"	  			
				template="/WEB-INF/layouts/standard.xhtml">

<ui:define name="content">

<div class="section">
	<h2>View Hotel</h2>
	<div class="field">
		<div class="label">Name:</div>
		<div class="output">#{hotel.name}</div>
	</div>
	<div class="field">
		<div class="label">Address:</div>
		<div class="output">#{hotel.address}</div>
	</div>
	<div class="field">
		<div class="label">City:</div>
		<div class="output">#{hotel.city}</div>
	</div>
	<div class="field">
		<div class="label">State:</div>
		<div class="output">#{hotel.state}</div>
	</div>
	<div class="field">
		<div class="label">Zip:</div>
		<div class="output">#{hotel.zip}</div>
	</div>
	<div class="field">
		<div class="label">Country:</div>
		<div class="output">#{hotel.country}</div>
	</div>
    <div class="field">
        <div class="label">Nightly rate:</div>
        <div class="output">
            <h:outputText value="#{hotel.price}">
                <f:convertNumber type="currency" currencySymbol="$"/>
            </h:outputText>
        </div>
    </div>
</div>

<div class="section">
	<!-- Use of a plain form element instead of the h:form component is a temporary workaround as spring-security 2.0-M2 is not forwarding to the correct URL when using a post -->
	<form id="hotel" method="get">
	<input name="execution" type="hidden" value="${flowExecutionContext.key}"/>
	<fieldset class="buttonGroup">
		<sf:commandButton id="book" ajaxEnabled="false" action="book" value="Book Hotel"/>&#160;
		<sf:commandButton id="cancel" ajaxEnabled="false" action="cancel" value="Back to Search"/>
	</fieldset>
	</form>
</div>

<!--Only used to enable view state saving with Facelets due to spring-security workaround above -->
<h:form id="hotel_stateSaving"></h:form>

</ui:define>
</ui:composition>